<!--EXCURSIONS ONLINE BOOKING-->
<div id="e321">
    <div class="excursions">

        <h1 class="franklin_gothic_metium_cond">Online Booking :: Excursions</h1>

        <br />

        <form action="<?=base_url('excursions')?>" method="POST" id="excusrsionsSearch">

            <div class="box" style="margin: 10px 11px 10px 0"> 
                <div id="exc_searchbox">

                    <div id="searchtop"></div>

                    <div id="searchContents">
                        <div class="sp_title">
                            <img alt="IT Montenegro" src="<?=base_url()?>assets/img/logo-small-booking.png">
                        </div>

                        <label for="eb_starting">Select Weekday:</label>
                        <br>
                        <select id="eb_starting" name="eb_starting" style="width: 180px; margin-top: 5px;">

                            <option selected="selected" value="Any" <?if(isset($_POST['eb_starting']) && $_POST['eb_starting']=='Any') echo 'selected="selected"' ?>>Any</option>

                            <option value="Monday" <?if(isset($_POST['eb_starting']) && $_POST['eb_starting']=='Monday') echo 'selected="selected"' ?>>Monday</option>
                            <option value="Tuesday" <?if(isset($_POST['eb_starting']) && $_POST['eb_starting']=='Tuesday') echo 'selected="selected"' ?>>Tuesday</option>
                            <option value="Wednesday" <?if(isset($_POST['eb_starting']) && $_POST['eb_starting']=='Wednesday') echo 'selected="selected"' ?>>Wednesday</option>
                            <option value="Thursday" <?if(isset($_POST['eb_starting']) && $_POST['eb_starting']=='Thursday') echo 'selected="selected"' ?>>Thursday</option>
                            <option value="Friday" <?if(isset($_POST['eb_starting']) && $_POST['eb_starting']=='Friday') echo 'selected="selected"' ?>>Friday</option>
                            <option value="Saturday" <?if(isset($_POST['eb_starting']) && $_POST['eb_starting']=='Saturday') echo 'selected="selected"' ?>>Saturday</option>
                            <option value="Sunday" <?if(isset($_POST['eb_starting']) && $_POST['eb_starting']=='Sunday') echo 'selected="selected"' ?>>Sunday</option>


                        </select>   
                        <br class="clearing" />

                        <label for="eb_freetext">Free Text:</label>
                        <br>
                        <input type="text" id="eb_freetext" name="eb_freetext" style="width: 177px; margin-bottom: 6px; border:1px solid #C0C0C0;" value="<?if(isset($_POST['eb_freetext'])) echo $_POST['eb_freetext'] ?>"/> <br class="clearing" />

                        <label for="exc_sort">Sort by:</label>
                        <br>
                        <select id="exc_sort" name="exc_sort" style="width: 180px; margin-top: 5px;">
                            <option value="none" <?if(isset($_POST['exc_sort']) && $_POST['exc_sort']=='none') echo 'selected="selected"' ?>>None</option>
                            <option value="name" <?if(isset($_POST['exc_sort']) && $_POST['exc_sort']=='name') echo 'selected="selected"' ?>>Name</option>
                            <option value="price" <?if(isset($_POST['exc_sort']) && $_POST['exc_sort']=='price') echo 'selected="selected"' ?>>Price</option>
                        </select>

                        <div class="s_btn">
                            <div class="atlas_btn">
                                <input type="submit" value="Clear" id="exc_clear">
                            </div>

                            <div class="atlas_btn">
                                <input type="submit" value="Search" id="exc_submit">
                            </div>
                        </div>     

                    </div>

                    <div id="searchBottom"></div>

                </div>
            </div>

        </form>

        <div class="exc">
            <div id="exc_list">

                <ul> 

                    <? $i = 0; foreach($excursions as $excursion):  $i++; ?>


                        <li class="exc_one <? if($i%3 == 0) echo 'mr0';?>">

                            <a href="<?=base_url('excursions/'.urlify::filter($excursion->title).'-'.$excursion->id)?>">

                                <?
                                    if(isset($excursion->g_path)):

                                        $pic_arr = explode('.',$excursion->f_name);
                                        $thumb_filename = 'thumbnail/'.$pic_arr[0].'_200x150_exacttop.'.$pic_arr[1];


                                    ?><span><img src="<?=$hosting?>pro-gallery/<?=$excursion->g_path?>/<?=$thumb_filename?>" alt="<?=$excursion->title?>" width="197" /></span>

                                    <?  endif; ?>

                                <span class="franklin_gothic_metium_cond exc_h3"><?=$excursion->title?></span>

                                <?
                                    $str= clean_html($excursion->description);

                                    if( mb_strlen($str) > 53){
                                        $str =  mb_substr($str, 0, 53).'...';
                                    }
                                ?>

                                <span class="list_description"><?=$str?></span>

                                <span class="img_bottom">
                                    <span class="price franklin_gothic_metium_cond">per person<br/>  <span class="ppp franklin_gothic_metium_cond"> &euro; <?=$excursion->adultPrice?></span></span> 
                                    <span class="s_btn" style="margin-right:0; margin-top: 5px;">
                                        <span class="atlas_btn" style="margin-right:0;">
                                            <span>Check Dates</span>
                                        </span>
                                    </span> 

                                    <br style="clear: both;" />
                                </span>

                                <?
                                    //$this->firephp->log($str.':'.mb_strlen($str));
                                ?>

                            </a>

                        </li> 

                        <? 
                            if($i%3 == 0)echo '<span class="clear"></span>';
                            endforeach;?>

                </ul>

            </div>
        </div>

    </div>

</div>   
<script type="text/javascript">
    $(document).ready(function(){ 

        $('#exc_clear').live('click',function(){

            $('#eb_starting').val('Any'); 
            $('#eb_freetext').val(''); 
            $('#exc_sort').val('none');

        });

        $('#eb_starting').live('change',function(){$('#excusrsionsSearch').submit()});

        $('#exc_sort').live('change',function(){$('#excusrsionsSearch').submit()});

        $('#excursion_id').live('change',function(){$('#excusrsionDetails').submit()});

    });
</script>
